﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace LuaFriends
{
    public partial class Form1 : Form
    {
        Highlighting syntax = new Highlighting();

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void richTextBox1_TextChanged(object sender, EventArgs e)
        {
            syntax.Update();
        }

        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            RichTextBox richTextBox1 = new RichTextBox();
            richTextBox1.Clear();
        }

        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog openfd = new OpenFileDialog();
            openfd.Title = "Open a Lua script...";
            openfd.Filter = "Lua Script(*.lua)|*.lua";
            openfd.ShowDialog();
            richTextBox1.LoadFile(openfd.FileName);
        }

        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog savefd = new SaveFileDialog();
            savefd.Title = "Save a Lua script...";
            savefd.Filter = "Lua Script(*.lua)|*.lua";
            savefd.ShowDialog();
            richTextBox1.SaveFile(savefd.FileName);
        }

        private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}
